package com.qianfeng.yime.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import com.qianfeng.yime.MainActivity;
import com.qianfeng.yime.R;

/**
 * Created by IDEA
 * User : SL
 * on  2015/3/9.
 * 21:35
 */
public class TutorialJumpFragment extends Fragment implements View.OnClickListener {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View ret = inflater.inflate(R.layout.fragment_tutorial_jump, container, false);

        Button btnJump = (Button) ret.findViewById(R.id.btn_tutorial_jump);

        if (btnJump != null) {
            btnJump.setOnClickListener(this);
        }

        return ret;
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.btn_tutorial_jump){
            FragmentActivity activity = getActivity();
            activity.startActivity(new Intent(activity, MainActivity.class));
            activity.finish();
        }
    }
}